import pluginNext from '@next/eslint-plugin-next';
import parser from '@typescript-eslint/parser';

const eslintConfig = [
    {
        name: 'ESLint Config - nextjs',
        languageOptions: {
            parser,
            parserOptions: {
                ecmaVersion: 'latest',
                sourceType: 'module',
                ecmaFeatures: {
                    jsx: true
                }
            }
        },
        plugins: {
            '@next/next': pluginNext
        },
        files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
        rules: {
            ...pluginNext.configs.recommended.rules,
            ...pluginNext.configs['core-web-vitals'].rules
        }
    }
    // ...compat.extends('next/core-web-vitals')
];

export default eslintConfig;
